<!-- MRGB01	(个人成绩公告) -->
<template>
  <div>
    <div class="item-info">
      <div
        :class="['single-item', item.flag ? 'active-item' : '']"
        v-for="(item, index) in singleItemList"
        :key="index"
      >
        <div>{{ item.name }}</div>
        <div class="item-logo">
          <img :src="item.logo" alt="" />
        </div>
      </div>
      <div class="single-item-info">
        <div class="info-line1">
          <div>{{ gameTitle }}</div>
          <div class="venue">{{ venueName }}</div>
        </div>
        <div class="info-line2">
          <div class="report-name">成绩公告</div>
          <div>{{ gameTime }}</div>
        </div>
      </div>
    </div>
    <div class="game-info">
      <el-col :span="3">
        <div>{{ tableData.column1 }}</div>
      </el-col>
      <el-col :span="9">
        <div class="game-a">{{ tableData.column2 }}</div>
      </el-col>
      <el-col :span="3">
        <div class="game-vs">{{ tableData.column3 }}</div>
      </el-col>
      <el-col :span="9">
        <div class="game-b">{{ tableData.column4 }}</div>
      </el-col>
    </div>
    <div class="game-table-data">
      <el-row :gutter="24">
        <el-col :span="3" class="col-style-1">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column
              prop="TableNo"
              label="台号"
              header-align="center"
              align="center"
            ></el-table-column>
          </el-table>
        </el-col>
        <el-col :span="9" class="col-style">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column prop="Order-A" label="编号" header-align="center" align="center">
            </el-table-column>
            <el-table-column label="姓名">
              <template slot-scope="scope">
                <div style="color:rgba(230,24,71,1)">
                  {{ scope.row['Name-A'] }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="Team-A" label="单位" min-width="130%"> </el-table-column>
            <el-table-column
              prop="Score-A"
              label="上轮积分"
              header-align="center"
              align="center"
            ></el-table-column>
          </el-table>
        </el-col>
        <el-col :span="3" class="col-style">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column prop="Result" header-align="center" align="center">
              <template slot="header" slot-scope="scope">
                <div class="game-vs-logo"></div>
              </template>
            </el-table-column>
          </el-table>
        </el-col>
        <el-col :span="9" class="col-style-2">
          <el-table :data="reportData" style="width: 100%">
            <el-table-column
              prop="Score-B"
              label="上轮积分"
              header-align="center"
              align="center"
            ></el-table-column>
            <el-table-column prop="Team-B" label="单位" min-width="130%"> </el-table-column>
            <el-table-column label="姓名">
              <template slot-scope="scope">
                <div style="color:rgba(60,135,247,1)">
                  {{ scope.row['Name-B'] }}
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="Order-B" label="编号" header-align="center" align="center">
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>
      <!-- <div class="game-legend">
        <div class="legend-title">注释</div>
        <div class="legend-content">
          <span class="legend-content-title">*</span>
          <span>先手</span>
        </div>
      </div> -->
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
export default {
  created() {
    this.venueName = this.$route.query.venueName
    this.gameTime = this.$route.query.gameTime
    this.gameTitle = this.$route.query.gameTitle
    this.filePath = this.$route.query.filePath
    this.getReportData()
  },
  props: {},
  data() {
    return {
      tableData: {
        column1: '对阵',
        column2: '黑方',
        column3: '当前成绩',
        column4: '白方'
      },
      filePath: '',
      venueName: '',
      gameTime: '',
      gameTitle: '',
      resultList: [
        {
          TableNo: '1',
          'Team-A': '江苏    ',
          'Order-A': '1',
          'Order-B': '2',
          'Score-A': '[2]  ',
          Result: '0:1   ',
          'Team-B': '上海    ',
          'Score-B': '[2]  ',
          'Name-A': ' 奚振扬 (13)',
          'Name-B': ' 朱建锋 (2) '
        },
        {
          TableNo: '2',
          'Team-A': '上海    ',
          'Order-A': '1',
          'Order-B': '2',
          'Score-A': '[2]  ',
          Result: '0.5:0.5  ',
          'Team-B': '湖北    ',
          'Score-B': '[2]  ',
          'Name-A': ' 葛凌峰 (14)',
          'Name-B': ' 梅凡 (6)   '
        }
      ],
      singleItemList: [
        {
          name: '五子棋',
          logo: require('@/assets/img/daily/GB.png'),
          flag: true
        }
      ]
    }
  },
  watch: {},
  computed: {
    ...mapState({
      reportData: state => state.schedule.reportData
    })
  },
  filters: {},
  components: {},
  methods: {
    getReportData() {
      this.$store
        .dispatch('getReportData', this.filePath + '.txt')
        .then(_ => {})
        .catch(error => {
          console.log(error)
        })
    }
  }
}
</script>
<style scoped lang="scss">
@import '@/assets/scss/item.scss';
</style>
